<#include "/tags/updatedSinceTag.ftl">
<#include "/tags/DDMMYYYY.ftl">
<#assign security=JspTaglibs["http://www.springframework.org/security/tags"] />
<#macro commentView ownerName commentId body commentUpdatedSince entryOwner commentType avatarURL='${rc.contextPath}/images/avatar.png'>
	<div class="useracc"> 
		<a class="avatar"><img src="${avatarURL}" alt="${ownerName}" width="50"/></a>
  		<div class="username">
  			<b style="color:#666;font-weight:normal">Gửi bởi:</b> <a href="${rc.contextPath}/${ownerName}" style="color: #ff6600;">${ownerName}</a>
  		</div>
  		<#if data?? && data.userInSession?? && (data.userInSession == ownerName || data.userInSession == entryOwner)>
  			<a class="commentDelete ${commentType}" rel="${commentId}" style="float:right"></a>	
  		<#else>
  			<@security.authorize ifAnyGranted="ROLE_ADMIN">
				<a class="commentDelete ${commentType}" rel="${commentId}" style="float:right"></a>
			</@security.authorize>
  		</#if>      	
      	<div class="updatetime"><@updatedSince minutes=commentUpdatedSince prefix='page.dashboard.commentCreatedDate'/></div>
      	<div class="comment">${body}</div>
	</div>
</#macro>